import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'
import IndexVue from '../../pages/IndexPage.vue';
import TeamVue from '../../pages/TeamPage.vue';
import UserVue from '../../pages/UserPage.vue';
import SearchVue from '../../pages/SearchPage.vue';
import TestVue from '../../pages/TestPage.vue';
import UserEditVue from '../../pages/UserEditPage.vue';
import SearchResultVue from '../../pages/SearchResultPage.vue';
import UserLoginVue from '../../pages/UserLoginPage.vue';
import TeamCreateVue from '../../pages/TeamCreatePage.vue';
import TeamMyselfVue from '../../pages/TeamMyselfPage.vue';
import TeamEditVue from '../../pages/TeamEditPage.vue';

// 声明路由配置
const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: 'home',
        component: IndexVue,
        meta: {
            description: '主页'
        }
    },
    {
        path: '/team',
        name: 'team',
        component: TeamVue,
        meta: {
            description: '队伍'
        }
    },
    {
        path: '/user',
        name: 'user',
        component: UserVue,
        meta: {
            description: '用户'
        }
    },
    {
        path: '/search',
        name: 'search',
        component: SearchVue,
        meta: {
            description: '搜索'
        }
    },
    {
        path: '/test',
        name: 'test',
        component: TestVue,
        meta: {
            description: '测试'
        }
    },
    {
        path: '/user/edit', // 这里因为需要多个参数，所以不采用动态传参
        name: 'userEdit',
        component: UserEditVue,
        meta: {
            description: '用户编辑'
        }
    },
    {
        path: '/list',
        name: 'userSearchList',
        component: SearchResultVue,
        meta: {
            description: '用户列表'
        }
    },
    {
        path: '/user/login',
        name: 'userLogin',
        component: UserLoginVue,
        meta: {
            description: '登录账户'
        }
    },
    {
        path: '/team/create',
        name: 'teamCreate',
        component: TeamCreateVue,
        meta: {
            description: '队伍创建'
        }
    },
    {
        path: '/team/myself',
        name: 'teamMyself',
        component: TeamMyselfVue,
        meta: {
            description: '我的队伍'
        }
    },
    {
        path: '/team/edit',
        name: 'teamEdit',
        component: TeamEditVue,
        meta: {
            description: '队伍编辑'
        }
    }

];

export default createRouter({
    history: createWebHashHistory(),
    routes,
})

